package service

import (
	"fmt"
	"rongyy/src/models"
)

type OperationService struct {
}

func (op *OperationService) OperationInfo(req *models.ReqOpera) ([]models.OperationRow, error) {
	data, err := (&HisService{}).OperationInfo(req)
	if data.ResultCode != "0" {
		return nil, fmt.Errorf(data.ResultMsg)
	}
	list := make([]models.OperationRow, 0)
	for _, item := range data.Data {
		if req.PatientId == item.PatientNo {
			list = append(list, item)
		}
	}
	return list, err
}
